<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../jsLib/angular-1.3.0.js"></script>
    <title></title>
</head>
<body ng-app="app" ng-controller="ShoppingController">

<h1>Shop!</h1>
<table>
    <tr ng-repeat="item in items">
        <td>{{item.title}}</td>
        <td>{{item.description}}</td>
        <td>{{item.price | currency}}</td>
    </tr>

</table>
<script>
    var app = angular.module('app', []);

    // Set up service factory to create our Items interface to the server-side database
    app.factory('Items', function(){
        var items = {};
        items.query = function(){
            // In real apps, we'd pull this data from the server…
            return [
                {title: 'Paint pots', description: 'Pots full of paint', price: 3.95},
                {title: 'Polka dots', description: 'Dots with polka', price: 2.95},
                {title: 'Pebbles', description: 'Just little rocks', price: 6.95}
            ];
        };

        return items;
    });
   app.controller('ShoppingController',function($scope,Items){
       $scope.items = Items.query();
   })
</script>
</body>
</html>